package com.kfm.bootmp.config;

import com.kfm.bootmp.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class MyExceptionHandler {

    @ExceptionHandler(Exception.class)
    public R handleException(Exception e){
        e.printStackTrace();
        log.info("异常信息:{}", e.getMessage());
        return R.error("系统异常");
    }
}
